#include"ProblemA.h"
#include"NewtonPoly.h"

double poly_at_x(double(*f)(double), 
                 const vector<double> &inter_pts, 
                 double x)
{
    int size = inter_pts.size();//get the number of interpolation points

    vector<double> vals_of_pts(size);
    for(int i = 0; i < size; i++)
        vals_of_pts[i] = f(inter_pts[i]);
        
    return Newton_poly_at_x(inter_pts, vals_of_pts, x);
}